package com.wyf.product.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.context.support.HttpRequestHandlerServlet;

import java.util.Map;

@RestController
@RequestMapping("/product")
public class ProductController {

    @Value("${server.port}")
    String port;

    @RequestMapping("/{id}")
    public String get(@PathVariable Integer id, @RequestHeader Map<String, String> headers) {
        System.out.println(headers.get("name"));
        System.out.println("查询商品" + id);
        return "查询商品" + " " + id + " " + port;
    }
}
